<?php

namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Services\IndexService;

use App\Models\Category;
use App\Models\Goods;

use App\Services\Api\GoodsService;
use App\Http\Resources\GoodsCollection;
class IndexController extends Controller
{
    public function index(IndexService $service)
    {
    	$datas = $service->getIndexData();
    	return $datas;
    }

    public function test(Request $request, GoodsService $service)
    {
    	$data = $service->getGoodsList($request->category);
    	return new GoodsCollection($data);
    }
}
